var Component = require('./compnent');
var inhertits = require('../utils/inherits');

function defineComponent(proto, SuperComponent) {
    if (typeof proto === 'function') {
        return proto;
    }
    if (typeof proto !== 'object') {
        throw new Error('[ZOOLON FATAL] param must be a plain object.');
    }

    function ComponentClass(option) {
        Component.call(this, option);
    }
    ComponentClass.prototype = proto;
    inhertits(ComponentClass, SuperComponent || Comment);
    return ComponentClass;
}
exports = module.exports = defineComponent;